<?php

//include_once '../../model/Word.php';
$idLesson = $_SESSION['idLesson'];

//$saveContinue = (bool) get_input('SaveContinue');
//$check_answers = (bool) get_input('check_answers');
//$skip = (bool) get_input('skip');
//
//if ($saveContinue != false) {
//    system_message("SaveContinue");
//}
//
//
//if ($check_answers != false) {
//    system_message("check_answers");
//}





$listListen = array();
$listen = new Listen();
$listListen = $listen->loadListenByLesson($idLesson);
$listen = $listListen[0];


session_start();

$_SESSION["listListen"] = $listListen;
$_SESSION["idListenCurrent"] = $listen->ID;


if (session_is_registered("listListen")) {
    system_messages("session is registered!");
}


if ($listListen != false) {
    system_message("Going to listen");
    forward(elgg_get_site_url() . "MyCourse/listen");
} else {
    register_error("can not going to listen");
    forward(REFERER); // REFERER is a global variable that defines the previous page
}
?>
    

